package com.kk.base.entity.admin;

import com.kk.base.annotion.ValidateEntity;
import com.kk.base.entity.BaseEntity;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 *
 */
@Entity
@Table(name="aging_query")
@EntityListeners(AuditingEntityListener.class)
@ToString
@Data
public class AgingQuery extends BaseEntity {

    @ValidateEntity(required = true,errorRequiredMsg = "始发地不能为空!")
    @Column(name = "origin",nullable=false,length = 80)
    private String origin;    //始发地

    @ValidateEntity(required = true,errorRequiredMsg = "目的地不能为空!")
    @Column(name = "destination",nullable=false,length = 80)
    private String destination; //目的地

    @ValidateEntity(required = true,requiredMaxValue=true,requiredMinValue = true,minValue=1,maxValue=10000,errorRequiredMsg="预计到达时间不能为空!",errorMinValueMsg="预计到达时间不能小于1天!",errorMaxValueMsg="预计到达时间不能超过10000天!")
    @Column(name = "eta",nullable=false)
    private Integer eta;   //预计到达时间

    @ValidateEntity(required = true,requiredMaxValue=true,requiredMinValue = true,minValue=1,maxValue=10000,errorRequiredMsg="每千克价格不能为空!",errorMinValueMsg="每千克价格不能小于1元!",errorMaxValueMsg="每千克价格不能超过10000元!")
    @Column(name = "price_per_kilogram",nullable=false)
    private Double pricePerKilogram;   //每千克价格

}
